from flask import Flask
import yaml


PORT = 9988
HOST = 'localhost'
# the static folder for this server
STATIC_PATH = './web/'

app = Flask(__name__, static_folder=STATIC_PATH)

head_json = {'Content-Type': 'application/json',
             'Access-Control-Allow-Origin': '*'}


@app.route('/', methods=['GET'])
def index():
    with open('password.yml', 'r', encoding='utf-8') as f:
        yml = yaml.safe_load(f)
    return yml, head_json

def run_server():
    app.run(debug=False, port=PORT, host=HOST)


if __name__ == '__main__':
    run_server()
